package com.xtm.exercise.utils;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.sql.SQLException;

/**
 * Clob转换String
 */
public class ClobToStrUtil {

    public String ClobToString(java.sql.Clob clob) throws SQLException, IOException {
        Reader is = clob.getCharacterStream();
        BufferedReader br = new BufferedReader(is);
        String s = br.readLine();
        StringBuffer sb = new StringBuffer();
        while (s != null) {
            sb.append(s);
            s = br.readLine();
        }
        String reString = sb.toString();
        return reString;
    }
}
